package org.springblade.oa.mapper;

import com.baomidou.mybatisplus.annotation.SqlParser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springblade.oa.vo.ExpenseAccount;
import org.springblade.oa.vo.PageQuery;

import java.util.List;
import java.util.Map;

/**
 * @author LK
 * @version 1.0.0
 * @Title: ExpenseAccountMapper.java
 * @Description: TODO    报销持久化接口
 * @date 2020/1/13 11:58
 */
public interface ExpenseAccountMapper extends BaseMapper<ExpenseAccount> {

	/**
	 * 获取报销列表
	 *
	 * @param expenseAccount
	 * @param pageQuery
	 * @return
	 */
	List<ExpenseAccount> getExpenseAccountList(@Param("expenseAccount") ExpenseAccount expenseAccount, @Param("pageQuery") PageQuery pageQuery);
	/**
	 * 部门审批人 +出纳获取报销列表
	 *
	 * @param expenseAccount
	 * @param pageQuery
	 * @return
	 */
	List<ExpenseAccount> getExpenseAccountList2(@Param("expenseAccount") ExpenseAccount expenseAccount,@Param("expenseAccount2") ExpenseAccount expenseAccount2, @Param("pageQuery") PageQuery pageQuery);

	/**
	 * 获取条数和总金额
	 *
	 * @param expenseAccount
	 * @param pageQuery
	 * @return
	 */
	Map getExpenseAccountSumTotalAndSumAmount(@Param("expenseAccount") ExpenseAccount expenseAccount, @Param("pageQuery") PageQuery pageQuery);

	/**
	 * 获取项目名称
	 *
	 * @param code
	 * @return
	 */
	String getProjectName(String code);
	String getProjectAbbName(String code);


	/**
	 * 获取项目名称列表
	 *
	 * @param leader
	 * @return
	 */
	List<Map<String, String>> getProjectNameList(String leader);

	/**
	 * 根据报销单id获取合成项目编号以及名称
	 *
	 * @param bxdid
	 * @return
	 */
	Map<String, String> getSynthesisProject(Integer bxdid);
	/**
	 * 查找同部门下的人员
	 * @param
	 * @return
	 */
	@SqlParser(filter=true)
	List<Map<String, Object>> getUser(Map<String,Object> params);

	/**
	 * 根据userId获取用户名称
	 * @param userId
	 * @return
	 */
	String getUserById(Integer userId);


}
